<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-blowdown-edit" th:object="${blowdown}">
        <input id="id" name="id" type="hidden" th:field="*{id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label">类型：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="ctype" id="ctype" th:field="*{ctype}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">存放编号：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="cid" id="cid" th:field="*{cid}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">数据值：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="vdata" id="vdata" th:field="*{vdata}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">数据单位：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="vunit" id="vunit" th:field="*{vunit}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">采集状态：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="status" id="status" th:field="*{status}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">采集时间：</label>
            <div class="col-sm-8">
                <input class="form-control" type="datetime-local" name="colldate" id="colldate" th:field="*{colldate}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">采集IP：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="collip" id="collip" th:field="*{collip}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">安装时间：</label>
            <div class="col-sm-8">
                <input class="form-control" type="datetime-local" name="startdate" id="startdate" th:field="*{startdate}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">更换时间：</label>
            <div class="col-sm-8">
                <input class="form-control" type="datetime-local" name="exdate" id="exdate" th:field="*{exdate}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">存放位置编号：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="deptid" id="deptid" th:field="*{deptid}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">录入人编号：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="uid" id="uid" th:field="*{uid}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">备注：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="demo" id="demo" th:field="*{demo}"/>
            </div>

    </form>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">
    var prefix = ctx + "iot/blowdown";

    /* $("#form-blowdown-edit").validate({
         rules:{
             xxxx:{
                 required:true,
             },
         }
     });  */

    function edit() {
        var id = $("input[name='id']").val();
        var ctype = $("input[name='ctype']").val();
        var cid = $("input[name='cid']").val();
        var vdata = $("input[name='vdata']").val();
        var vunit = $("input[name='vunit']").val();
        var status = $("input[name='status']").val();
        var deptid = $("input[name='deptid']").val();
        var uid = $("input[name='uid']").val();
        var demo = $("input[name='demo']").val();
        var menuIds = $.tree.getCheckedNodes();
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "iot/blowdown/edit",
            data : {
                "id": id,
                "ctype": ctype,
                "cid": cid,
                "vdata": vdata,
                "vunit": vunit,
                "status": status,
                "deptid": deptid,
                "uid": uid,
                "demo": demo,
                "delflag": delflag,
                "menuIds": menuIds
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-blowdown-edit').serialize());
        }
    }
</script>
</body>
</html>
